namespace Crux.Core.Data;
/// <summary>
///
/// </summary>
public struct PageOption
{
    /// <summary>
    ///
    /// </summary>
    /// <param name="pageSize"></param>
    /// <param name="pageIndex"></param>
    public PageOption(
        int? pageSize,
        int? pageIndex)
    {
        if (null != pageSize && pageSize < 0)
            PageSize = null;
        else
            PageSize = pageSize;
        if (null != pageIndex && pageIndex <= 0)
            PageIndex = null;
        else
            PageIndex = pageIndex;
    }
    /// <summary>
    ///
    /// </summary>
    public int? PageIndex { get; init; }
    /// <summary>
    ///
    /// </summary>
    public int? PageSize { get; init; }
}
